package com.qfedu.edu.observer.notify.impl;

import com.qfedu.edu.manager.SmsManager;
import com.qfedu.edu.observer.notify.base.Observer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class SmsObserver implements Observer {
    @Override
    public void notifyList(String msg) {
        log.info("短信通知：{}", msg);
        int mobile_code = (int) ((Math.random() * 9 + 1) * 100000);
        new SmsManager().sendSMS(mobile_code);
    }
}
